<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>测试页</title>
</head>
<body>
	<img alt="" src="../../upload/612c7fa8-6ca6-4660-9061-9e50460ea709bc1.png">
	<a href="/test/download/?filename=612c7fa8-6ca6-4660-9061-9e50460ea709bc1.png">下载图片</a>
	<video width="320" height="240"src="../../upload/51348d68-7b96-4222-a90b-94e420a53a5cQQ视频20200308150857.mp4" controls="controls">
	</video>
	<c:choose>
		<c:when test="${not empty courseViews.getResult()}">
			<ul>
			<c:forEach items="${courseViews.getResult()}" var="courseViews">		
			<li><video width="320" height="240"src="../../upload/${courseViews.viewRul }" controls="controls">
	</video></li>
			<li>${courseViews.courseView }</li>
			</c:forEach>
			</ul>
		</c:when>
		<c:otherwise>
			没有结果
		</c:otherwise>
	</c:choose>
<a href="/test/courseDesciption">课程介绍页</a><br/>
<a href="/test/courseInfo">课程详情页</a><br/>
<a href="/admin/User/teacherLogin">教师登录页</a><br/>
<a href="/test/gl">gl.jsp</a><br/>
<a href="/test/gr">gr.jsp</a><br/>
<a href="/test/ht">ht.jsp</a><br/>
<a href="/test/sp">sp.jsp</a><br/>
<a href="/index/">首页</a><br/>
<a href="/test/qualityCourses">所有精品课程页</a><br/>
<a href="/test/teacherShow">老师申请查看页</a><br/>



<br>
<br>


	<form id="uploadForm" enctype="multipart/form-data" method="post">
		<input type="file" name="file">
	</form>
	<br>
	<input type="button" id="upload" value="上传">
	<span id="msg">上传结果</span>
	
</body>
<script src="${path}/static/admin/js/jquery-2.2.3.min.js"></script>
<script type="text/javascript">
$(function() {
	$('#upload').click(function() {
		var formData = new FormData($('#uploadForm')[0]);
		$.ajax({
			type : 'POST',
			url : '/test/upload',
			data : formData,
			cache : false,
			processData : false,
			contentType : false,

		}).success(function(data) {
			var result = JSON.parse(data);
			$("#msg").html(result.back).css("color","red");
		}).error(function() {
			$("#msg").html("上传失败").css("color","red");
		});
	});
});


</script>
</html>